import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/question',
    name: 'question',
    component: () => import('../views/QuestionHome.vue')
  },
  {
    path: '/reply',
    name: 'qreply',
    component: () => import('../views/ReplyHome.vue')
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/sign',
    name: 'sign',
    component: () => import('../views/Sign.vue')
  },
  {
    path: '/user-manage',
    name: 'user-manage',
    component: () => import('../views/admin/UserManage.vue')
  },
  {
    path: '/module-manage',
    name: 'module-manage',
    component: () => import('../views/admin/ModuleManage.vue')
  },
  {
    path: '/data-center',
    name: 'data-center',
    component: () => import('../views/admin/DataCenter.vue')
  },
  {
    path: '/question-add',
    name: 'question-add',
    component: () => import('../views/QuestionAdd.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
